//
//  UserPageDetailView.m
//  BGM
//
//  Created by liuqin on 2018/11/27.
//  Copyright © 2018年 com.alirtc.demo. All rights reserved.
//

#import "UserPageDetailView.h"
#import "BGMTextView.h"
#import "Common.h"

@implementation UserPageDetailView

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if(self != nil){
         float y = 90;
 
        
        BGMTextView *citydView = [[BGMTextView alloc]initWithFrame:CGRectMake(30, y+25, SCREENW-60, 50)];
        citydView.tag = 301;
        [citydView.iconImage setImage:[UIImage imageNamed:@"loginCity"]];
        citydView.myText.placeholder = @"城市";
        citydView.rightBtn.hidden = NO;
        citydView.rightBtn.backgroundColor = [UIColor clearColor];
        citydView.rightBtn.imageEdgeInsets = UIEdgeInsetsMake(0,30,0,0);
        [citydView.rightBtn setImage:[UIImage imageNamed:@"gengduo"] forState:UIControlStateNormal];
        [self addSubview:citydView];
        
        UIButton *citybtn = [[UIButton alloc]initWithFrame:CGRectMake(citydView.frame.origin.x, citydView.frame.origin.y, citydView.frame.size.width, citydView.frame.size.height)];
        [self addSubview:citybtn];
        citybtn.backgroundColor = [UIColor clearColor];
        citybtn.tag = 101;
        [citybtn addTarget:self action:@selector(clickbtn:) forControlEvents:UIControlEventTouchUpInside];
        
        y = y+25+50;
        BGMTextView *jobView = [[BGMTextView alloc]initWithFrame:CGRectMake(30, y+25, SCREENW-60, 50)];
        jobView.tag = 201;

        [jobView.iconImage setImage:[UIImage imageNamed:@"loginjob"]];
        jobView.myText.placeholder = @"行业";
        jobView.rightBtn.hidden = NO;
        jobView.rightBtn.backgroundColor = [UIColor clearColor];
        jobView.rightBtn.imageEdgeInsets = UIEdgeInsetsMake(0,30,0,0);
        [jobView.rightBtn setImage:[UIImage imageNamed:@"gengduo"] forState:UIControlStateNormal];
        [self addSubview:jobView];
        UIButton *jobbtn = [[UIButton alloc]initWithFrame:CGRectMake(jobView.frame.origin.x, jobView.frame.origin.y, jobView.frame.size.width, jobView.frame.size.height)];
        [self addSubview:jobbtn];
        jobbtn.backgroundColor = [UIColor clearColor];
        jobbtn.tag = 102;
        [jobbtn addTarget:self action:@selector(clickbtn:) forControlEvents:UIControlEventTouchUpInside];
        
        
        y = y+25+50;
        BGMTextView *titleView = [[BGMTextView alloc]initWithFrame:CGRectMake(30, y+25, SCREENW-60, 50)];
        titleView.tag = 203;
        [titleView.iconImage setImage:[UIImage imageNamed:@"loginTitle"]];
        titleView.myText.placeholder = @"个性标签";
        titleView.rightBtn.hidden = NO;
        titleView.rightBtn.backgroundColor = [UIColor clearColor];
        titleView.rightBtn.imageEdgeInsets = UIEdgeInsetsMake(0,30,0,0);
        [titleView.rightBtn setImage:[UIImage imageNamed:@"gengduo"] forState:UIControlStateNormal];
        [self addSubview:titleView];
        UIButton *titlebtn = [[UIButton alloc]initWithFrame:CGRectMake(titleView.frame.origin.x, titleView.frame.origin.y, titleView.frame.size.width, titleView.frame.size.height)];
        [self addSubview:titlebtn];
        titlebtn.backgroundColor = [UIColor clearColor];
        titlebtn.tag = 103;
        [titlebtn addTarget:self action:@selector(clickbtn:) forControlEvents:UIControlEventTouchUpInside];
        
        
        y = y+25+50;

        UIButton *nextBtn = [[UIButton alloc]initWithFrame:CGRectMake(50, y+100, SCREENW-100, 50)];
        nextBtn.backgroundColor = bgmColor(224, 224, 224);
        nextBtn.layer.cornerRadius = 25;
        nextBtn.layer.masksToBounds = YES;
        [nextBtn setTitle:@"立即进入" forState:UIControlStateNormal];
        [nextBtn setTitleColor:bgmgrayColor forState:UIControlStateNormal];
        
        [nextBtn setBackgroundImage:[UIImage imageNamed:@"loginSele"] forState:UIControlStateSelected];
        [self addSubview:nextBtn];
        
        [nextBtn addTarget:self action:@selector(clickNext) forControlEvents:UIControlEventTouchUpInside];
        UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, SCREENH-60, SCREENW, 40)];
        label.text = @"向下滑动 填写基本信息";
        label.font = [UIFont systemFontOfSize:13];
        label.textColor = bgmgrayColor;
        label.textAlignment = NSTextAlignmentCenter;
        [self addSubview:label];
    }
    return self;
}
- (void)clickNext{
    [self.deleagte gotoNextVC];
}

- (void)clickbtn:(UIButton *)btn{
    int tag = (int)btn.tag;
    switch (tag) {
        case 100:
        {
        }
            break;
        case 101:
        {
            [self.deleagte clickCity];
        }
            break;
        case 102:
        {
            [self.deleagte getJob];
        }
            break;
        case 103:
        {
            [self.deleagte getTitle];
            
        }
            break;
            
        default:
            break;
    }
}

 

@end
